package com.android.camera.one.v2.common;

import com.android.camera.debug.Log;
import com.android.camera.one.OneCameraCharacteristics.FaceDetectMode;
import com.google.common.base.Supplier;

public class FaceDetectModeBaseEnable implements Supplier<FaceDetectMode> {
	private static final Log.Tag TAG = new Log.Tag("FaceBaseEnable");
	private final Supplier<FaceDetectMode> mFaceMode;
    private final Supplier<Boolean> mFaceEnable;
    
	public FaceDetectModeBaseEnable(Supplier<FaceDetectMode> faceMode, Supplier<Boolean> enable) {
		mFaceMode = faceMode;
		mFaceEnable = enable;
	}
	
	@Override
	public FaceDetectMode get() {
		if (!mFaceEnable.get()) {
			Log.d(TAG, "FaceDetectMode.NONE");
			return FaceDetectMode.NONE;
		}
		FaceDetectMode mode = mFaceMode.get();
		Log.d(TAG, "FaceDetectMode "+mode);
		return mode;
	}

}
